﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class asptoaspx : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string flag = Request.Form.Get("flag");
            if (flag == "1")//登录成功
            {
                Session["AdminID"] = Request.Form.Get("AdminID");
                Session["Adminname"] = Request.Form.Get("Adminname");
                Session["IsAdmin"] = Request.Form.Get("IsAdmin");
                Session["KEY"] = Request.Form.Get("KEY");
            }
            else
            {
                Session.Remove("AdminID");
                Session.Remove("Adminname");
                Session.Remove("IsAdmin");
                Session.Remove("KEY");
            }
            Response.Redirect(Request.UrlReferrer.LocalPath.Replace("check","admin"));
        }
    }
}